<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 500px;
            height: 500px;
            border: 2px solid black;
            margin: 100px auto;
            display: flex;
            /* 设置主轴方向
            colum 垂直
            row 水平
            row-reverse 水平反向
            colum-reverse */
            flex-direction: row;
            /* 主轴对齐方式 
            flex-start 居左
            flex-end 居右
            center 居中
            space-between 两端对齐
            space-around 距离环绕 自身左右等距
            */
            justify-content: flex-start;
            /* 侧轴对齐方式
            flex-start
            flex-end
            center */
            align-items: center;
            /* 折行 
            wrap
            nowrap*/
            flex-wrap: wrap;
            /* 行间距 
            flex-start
            flex-end
            center
            space-around
            apce-between*/
            align-content: flex-start;
        }
        .box div{
            width: 100px;
            height: 100px;
            border: 1px solid red;
        }
        .box span{
            width: 100px;
            height: 100px;
            border: 1px solid red;
            /* 弹性盒时且只有一个元素，可水平垂直居中 */
            margin: auto;
        }
    </style>
</head>
<body>
    <div class="box">
        <div>111</div>
        <div>222</div>
        <div>333</div>
        <div>444</div>
        <div>555</div>
        <div>666</div>
        <div>444</div>
        <div>555</div>
        <div>666</div>
    </div>
</body>
</html>